package com.example.demo.config;


import com.example.demo.util.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//全局异常处理
@RestControllerAdvice
public class GlobeExceptionHandler {

    @ExceptionHandler(Exception.class)

    public Result allException(Exception e) {
        return new Result(501, "全局异常", e.getMessage());
    }

}
